# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.2, value = 0.7557873314678198, attri = front
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.2, value = 0.4334351811436054, attri = back
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.2, value = 0.7726174995355749, attri = other
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.05, value = 0.5345182895414735, attri = glasses
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.09, value = 0.5708397733127254, attri = gender
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.01, value = 0.23415765069551778, attri = age
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.05, value = 0.7460072127769191, attri = race
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.05, value = 0.5154559505409583, attri = emotion
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.05, value = 0.6695002575991756, attri = mask
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.05, value = 0.7550231839258115, attri = hat
# 2023-11-27 21:18:19,938 - root - INFO - weight = 0.05, value = 0.622359608449253, attri = whiskers

data = """2023-12-10 15:10:15,247 - root - INFO - weight = 0.2, value = 0.785041974052404, attri = front
2023-12-10 15:10:15,247 - root - INFO - weight = 0.2, value = 0.5124399825403754, attri = back
2023-12-10 15:10:15,247 - root - INFO - weight = 0.2, value = 0.8370796953371726, attri = other
2023-12-08 23:36:42,110 - root - INFO - weight = 0.05, value = 0.676531518200651, attri = glasses
2023-12-08 23:36:42,110 - root - INFO - weight = 0.09, value = 0.7224030778336786, attri = gender
2023-12-08 23:36:42,110 - root - INFO - weight = 0.01, value = 0.31015093222846996, attri = age
2023-12-08 23:36:42,110 - root - INFO - weight = 0.05, value = 0.6549274933412252, attri = race
2023-12-08 23:36:42,110 - root - INFO - weight = 0.05, value = 0.5537141166025451, attri = emotion
2023-12-08 23:36:42,110 - root - INFO - weight = 0.05, value = 0.6617342408996745, attri = mask
2023-12-08 23:36:42,110 - root - INFO - weight = 0.05, value = 0.7919502811482687, attri = hat
2023-12-08 23:36:42,110 - root - INFO - weight = 0.05, value = 0.6596626220775378, attri = whiskers"""

lines = data.split('\n')

weighted_sum = 0.0

for line in lines:
    # Extracting weight and value from each line
    weight_index = line.find('weight = ') + len('weight = ')
    value_index = line.find('value = ') + len('value = ')
    weight = float(line[weight_index:line.find(',', weight_index)])
    value = float(line[value_index:line.find(',', value_index)])
    print(weight * value)
    # Calculating the weighted sum
    weighted_sum += weight * value

print(f"Weighted Sum: {weighted_sum}")
